﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WeddingEventManagement_API
{
    public class QueryManager
    {

        public Search_DTO AutoSearch(string q)
        {
            return new Search_DTO()
            {
                Clients = new ClientManager().GetClients(q).ToList(),
                Events = new EventManager().GetEvents(q).ToList(),
                Locations = new LocationManager().GetLocations(q).ToList()
            };
        }

        public Search_DTO AutoSearch(string q, int take)
        {
            return new Search_DTO()
            {
                Clients = new ClientManager().GetClients(q).Take(take).ToList(),
                Events = new EventManager().GetEvents(q).Take(take).ToList(),
                Locations = new LocationManager().GetLocations(q).Take(take).ToList()
            };
        }
    }
}
